lst = [3, 5, 1, 6, 7, 34, 9, 2, 6, 8]

num = input("从键盘输入一个数：")
length = len(lst)


for i in range(0, length):
    for j in range(i, length):
        if lst[i] + lst[j] == int(num):
            print(f"列表中和为{num}的数为{lst[i], lst[j]}")
            print(f"两个数在数列的下标分别为：{i, j}")
    break